package com.dqyt.app.controller;

import com.dqyt.app.service.AppCustomerUserService;
import com.dqyt.khjc.bean.ResultMsg;
import com.dqyt.khjc.mapper.CustomerUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
public class AppCustomerUserController {

    @Autowired
    private AppCustomerUserService appCustomerUserService;

    /**
     * 查询所属机构下面的人员列表
     * @param request
     * @param customerId
     * @return
     */
    @RequestMapping(value = "/sample/getCuUsersByCuId", method = {RequestMethod.GET,RequestMethod.POST})
    public ResultMsg getCuUsersByCuId(HttpServletRequest request,long userId, String token, int customerId){
        ResultMsg resultMsg = appCustomerUserService.getCuUsersByCuId(request,userId,token,customerId);
        return resultMsg;
    }



    /**
     *
     * @param userName  客户人员名称
     * @param phone   客户人员手机
     * @param customerId 客户id
     * @param account  客户人员账号
     * @param password  客户人员密码
     * @param password2  确认密码
     * @return
     */
    @RequestMapping(value = "/sample/addCustomerUserApp", method = {RequestMethod.POST})
    public  ResultMsg addCustomerUser(HttpServletRequest request,long userId, String token,String userName,String phone,int customerId,
                                      String account,String password ,String password2){
        ResultMsg resultMsg = appCustomerUserService.addCustomerUserApp(request,userId,token, userName, phone,customerId,account,password,password2);
        return resultMsg;
    }


}
